<?
ob_start();
session_start();
include("../conf/config.php");
include("../conf/database.php");
include("../conf/tools.php");

$curTime=getIndianDateTime();
$prgmem_id=$_GET["prgmem_id"];
$mode=$_GET["mode"]; 

foreach($_POST as $key => $value) { $arr_data[$key]=$value;}
$arr_data["arr_time"]=str_pad($arr_data["ahrs"],2,"0",STR_PAD_LEFT).":".str_pad($arr_data["amins"],2,"0",STR_PAD_LEFT)." ".$arr_data["arr_time_sec"];
$arr_data["dep_time"]=str_pad($arr_data["dhrs"],2,"0",STR_PAD_LEFT).":".str_pad($arr_data["dmins"],2,"0",STR_PAD_LEFT)." ".$arr_data["dep_time_sec"];


foreach($arr_data as $key => $value) { $arr_data[$key]=addslashes($value); }
$arr_data["rec_status"]=1;

if($prgmem_id>0){

update_qry("bkitc_program_members",$arr_data,"prg_mem_id=".$prgmem_id);
qry_data("update bkitc_program_members set admin_last_updated='".$curTime."' where prg_mem_id=".$prgmem_id);

}
else{
	$prg_id=insert_qry("bkitc_program_members",$arr_data);
}


header("location:edit_prg_mem.php?mode=edit&prgmem_id=".$prgmem_id);
?>



